package com.kaifamiao.demo.d0718;

public class Demo04 {

    public static void main(String[] args) {
        // 1 .. 1000

        int sum = 0;
        int num = 1;

        // 1001 * 500 = 100100 * 5 = 500500
        do {
            sum = sum + num;
            num ++;
        }while(num <= 1000);


        System.out.println(sum);

    }
}
